package servlet.ware;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import service.GoodsService;


@WebServlet("/index")
public class IndexServelt extends HttpServlet {
	
       private	GoodsService	gService = new GoodsService();
 
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
	
		
	List<Map<String,Object>>		scrollList = gService.getScrollGoods();
	request.setAttribute("scrollList", scrollList);
		
	List<Map<String,Object>>	hotList =  gService.getHotGoodsList();
	request.setAttribute("hotList", hotList);	
	
	List<Map<String,Object>>	newList	= 	gService.getNewGoodsList();
	request.setAttribute("newList", newList);
	request.getRequestDispatcher("index.jsp").forward(request, response);
	}

	
}
